$(document).ready(function() {
    $("#user").submit(function() {
        var user = $("#user").serializeObject();
        alert("user = " + JSON.stringify(user) + ", " + user);
//        $.post("registerUser.do", user, function(data) {
//            alert("data = " + data);
//        }, "json");
        $.ajax({
            type: "post",
            contentType: "application/json",
            url: "registerUser.do",
            data: JSON.stringify(user),
            success: function(data) {
                alert("data = " + data);
            },
            error: function(data) {
                alert("data = " + data);
            }
        });
        return false;
    });

    $('#clearCache').on('click', function(){
       $.ajax({
           type: 'post',
           url: 'clearCache.do',
           dataType: 'text',
           success: function(data){
               alert('ok, ' + data);
           },
           error: function(data){
               alert('error, ' + data);
           }
       })
    });

});


//$(window).load(function(){
//
//    //fix bug when window is loading the helper blocks are load first
//    $('.content-viewer').addClass('lifted-corners');
//
//});